package milu.report;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;

public interface Reporting {

	void add(String msg);

	String asString();
}

class SimpleReporting implements Reporting {
	private List<String> messages = new ArrayList<String>();

	@Override public void add(String msg) {
		messages.add(msg);
	}

	@Override public String asString() {
		StringWriter sw = new StringWriter();
		PrintWriter pw = new PrintWriter(sw);
		for (String msg : messages)
			pw.println("* " + msg);
		pw.close();
		return sw.toString();
	}

}